<?php

namespace app\common\model\tysj;


abstract class StoreSubsidiaryOne extends CUBase {
	protected $privacyFields = ['id', 'status', 'updatetime'];

	protected static function init()
    {
        parent::init();

        // 注册 before_insert 事件
        self::beforeUpdate(function ($data) {
        	$model = loadModel('tysj\\Store');
            $model->reset($data['sid']);
            return $data;
        });
    }

	//所属店铺
	public function store() {
		return $this->hasOne('store', 'sid', 'id');
	}
}